package excepuion;

public class TryCatchDemo {
    public static void main(String[] args) {
        try {
            System.out.println("程序开始了");
            //String str = null;
            //System.out.println(str.length());
            String str1 = "zxc";
            System.out.println(str1.charAt(5));
            System.out.println("!!!!!!!");
        }catch (NullPointerException e){
            System.out.println("出现空指针异常,并处理完毕了" );
        }catch (StringIndexOutOfBoundsException e){
            System.out.println("出现字符串下标越界异常,并处理完毕了");
        }catch (Exception e ){
            System.out.println("反正除了个错");
        }
    }
}
